//
//  CHBaseButton.swift
//  nurseApp
//
//  Created by cyptt on 2022/7/22.
//

import UIKit

 public class CHBaseButton: UIButton {

  
   public var btnCallback:((_ btn:UIButton) -> ())?
   public override func awakeFromNib(){
        super.awakeFromNib()
    }

    
   public override init(frame: CGRect) {
        super.init(frame: frame)
        
        
        
        self.addTarget(self, action: #selector(btnClick(btn:)), for: .touchUpInside)
       
    }
   public func btnClickCallBack(closure:@escaping(_ btn:UIButton)-> Void){
     
       self.btnCallback = closure
    }
    
    @objc func btnClick(btn:UIButton){
        if self.btnCallback != nil{
            self.btnCallback!(btn)
        }
    }
    required init?(coder: NSCoder) {
        super.init(coder: coder)
      
    }
}

